//
//  FXTUserModel.m
//  OfferJob
//
//  Created by 郑州动力无限科技 on 2017/6/30.
//  Copyright © 2017年 郑州动力无限科技. All rights reserved.
//

#import "FXTUserModel.h"

@implementation FXTUserModel
-(instancetype)initWithDictionary:(NSDictionary *)accountDic {
    if (self =[super init]) {
        [self setValuesForKeysWithDictionary:accountDic];
    }
    return self;
}
+(instancetype)dicWithUserAccount:(NSDictionary *)accountDic {
    return [[self alloc]initWithDictionary:accountDic];
}

// 避免不必要的key产生崩溃
-(void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key {
    
}

/**
 *  获得存储对象调用
 */
- (id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {
        self.token = [decoder decodeObjectForKey:@"token"];
        self.userid = [decoder decodeObjectForKey:@"userid"];
        self.telephone = [decoder decodeObjectForKey:@"telephone"];
        self.phone = [decoder decodeObjectForKey:@"phone"];
        self.header_pic = [decoder decodeObjectForKey:@"header_pic"];
        self.nickname = [decoder decodeObjectForKey:@"nickname"];
        self.exten_code = [decoder decodeObjectForKey:@"exten_code"];
    }
    return self;
}

/**
 *  存储对象到文件调用
 */
- (void)encodeWithCoder:(NSCoder *)encoder
{
    [encoder encodeObject:self.userid forKey:@"userid"];
    [encoder encodeObject:self.telephone forKey:@"telephone"];
    [encoder encodeObject:self.token forKey:@"token"];
    [encoder encodeObject:self.phone forKey:@"phone"];
    [encoder encodeObject:self.nickname forKey:@"nickname"];
    [encoder encodeObject:self.header_pic forKey:@"header_pic"];
    [encoder encodeObject:self.exten_code forKey:@"exten_code"];
}
@end
